package coroutines.cancel

import kotlinx.coroutines.*

class iaAliveTest {
}

fun main() {
    runBlocking {
        val job = launch(Dispatchers.Default) {
            while (true) {
                println("哈哈哈")
                if (!isActive) {
                    return@launch
                }
            }
        }

        job.start()

        delay(10)

        job.cancel()
    }
}